]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gtk-embed: Don't try to compare with unrealized window
authorJonas Ådahl <jadahl@gmail.com>
Thu, 15 Dec 2016 11:34:10 +0000 (19:34 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Thu, 15 Dec 2016 11:42:48 +0000 (19:42 +0800)
After having embedded a Gtk window, we start to listen for the
corresponding MetaWindow to know when it has been mapped by the
compositor. If the embedder does not realize the window immediately,
and some other window is created and mapped before the embedder
realizes the window, we would prior to this patch try to dereference
the not created GdkWindow. Fix this by NULL checking the GdkWindow
before dereferencing. We will never miss the needed MetaWindow creation
since it can not have been mapped have it not yet been realized.

https://bugzilla.gnome.org/show_bug.cgi?id=776130

src/shell-gtk-embed.c

index 3f306136f835c2b77d09c4ea6f2e8a3e90268022..176b4132054c02c5b59df0da75f801e30c87e552 100644 (file)
@@ -66,7 +66,7 @@ shell_gtk_embed_window_created_cb (MetaDisplay   *display,
   Window xwindow = meta_window_get_xwindow (window);
   GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (priv->window));
 
-  if (xwindow == gdk_x11_window_get_xid (gdk_window))
+  if (gdk_window && xwindow == gdk_x11_window_get_xid (gdk_window))
     {
       ClutterActor *window_actor =
         CLUTTER_ACTOR (meta_window_get_compositor_private (window));